#include "stdafx.h"
#include "frameresource.h"

FrameResource::FrameResource(ID3D12Device* device, UINT passCnt, UINT objCnt, UINT materialCount)
{
	ThrowIfFailed(device->CreateCommandAllocator(
		D3D12_COMMAND_LIST_TYPE_DIRECT,
		IID_PPV_ARGS(&cmdListAlloc)));
	matCB = std::make_unique<UploadBuffer<MaterialConstants>>(device, materialCount, true);
	passCB = std::make_unique<UploadBuffer<PassConstants>>(device, passCnt, true);
	objCB = std::make_unique<UploadBuffer<ObjectConstants>>(device, objCnt, true);
}

FrameResource::FrameResource()
{
}